#include<iostream>
using namespace std;

const int N = 1e5 + 10;
char arr[N] = { 0 };

int yes_no(char arr[N], size_t sz)
{
	for (int i = 0; i < sz / 2; i++)
	{
		for (int j = sz - 1; j > sz / 2; j--)
		{
			if (arr[i] != arr[j])
			{
				return 1;
			}
		}
	}
	return 0;
}

int main()
{
	size_t  p = 0;
	char a = getchar();
	while (a != '\n')
	{
		arr[p] = a;
		p++;
		a = getchar();
	}
	if (p <= 3)
	{
		cout << "-1";
		return 0;
	}
	else
	{
		int k = p;
		for (int i = 0; i < k / 2; i++)
		{
			if (k % 2 == 1)
			{
				if (arr[i] != arr[i + k / 2 + 1])
				{
					swap(arr[i], arr[i + k / 2 + 1]);
					swap(arr[k - 1 - i], arr[k - (i + k / 2 + 1) - 1]);
					goto end;
				}
			}
			else
			{
				if (arr[i] != arr[i + k / 2])
				{
					swap(arr[i], arr[i + k / 2]);
					swap(arr[k - 1 - i], arr[k - (i + k / 2) - 1]);
					goto end;
				}
			}
		}
		cout << "-1";
		return 0;
		end:
		for (int i = 0; i < k; i++)
		{
			cout << arr[i];
		}
		return 0;
	}
	return 0;
}